//package com.ruoyi.web.controller.finance;
//
//import com.ruoyi.common.annotation.Log;
//import com.ruoyi.common.core.controller.BaseController;
//import com.ruoyi.common.core.domain.AjaxResult;
//import com.ruoyi.common.core.page.TableDataInfo;
//import com.ruoyi.common.enums.BusinessType;
//import com.ruoyi.common.utils.poi.ExcelUtil;
//import com.ruoyi.finance.domain.Advance;
//import com.ruoyi.finance.domain.PaymentSlips;
//import com.ruoyi.finance.service.IAdvanceService;
//import com.ruoyi.finance.service.IPaymentSlipsService;
//import com.ruoyi.procured.domain.RequestAdvance;
//import com.ruoyi.procured.service.IRequestAdvanceService;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.security.access.prepost.PreAuthorize;
//import org.springframework.web.bind.annotation.*;
//
//import javax.servlet.http.HttpServletResponse;
//import java.util.List;
//
///**
// * 预付款Controller
// *
// * @author ruoyi
// * @date 2023-11-24
// */
//@RestController
//@RequestMapping("/finance/advance")
//public class AdvanceController extends BaseController
//{
//    @Autowired
//    private IAdvanceService advanceService;
//    @Autowired
//    private IRequestAdvanceService requestAdvanceService;
//    @Autowired
//    private IPaymentSlipsService paymentSlipsService;
//
//    /**
//     * 查询预付款列表
//     */
//    @PreAuthorize("@ss.hasPermi('finance:advance:list')")
//    @GetMapping("/list")
//    public TableDataInfo list(Advance advance)
//    {
//        startPage();
//        List<Advance> list = advanceService.selectAdvanceList(advance);
//        return getDataTable(list);
//    }
//
//    /**
//     * 导出预付款列表
//     */
//    @PreAuthorize("@ss.hasPermi('finance:advance:export')")
//    @Log(title = "预付款", businessType = BusinessType.EXPORT)
//    @PostMapping("/export")
//    public void export(HttpServletResponse response, Advance advance)
//    {
//        List<Advance> list = advanceService.selectAdvanceList(advance);
//        ExcelUtil<Advance> util = new ExcelUtil<Advance>(Advance.class);
//        util.exportExcel(response, list, "预付款数据");
//    }
//
//    /**
//     * 获取预付款详细信息
//     */
//    @PreAuthorize("@ss.hasPermi('finance:advance:query')")
//    @GetMapping(value = "/{requestId}")
//    public AjaxResult getInfo(@PathVariable("requestId") Long requestId)
//    {
//        return success(advanceService.selectAdvanceByAdvanceId(requestId));
//    }
//
//
//    /**
//     * 修改预付款
//     */
//    @PreAuthorize("@ss.hasPermi('finance:advance:edit')")
//    @Log(title = "预付款", businessType = BusinessType.UPDATE)
//    @PutMapping
//    public AjaxResult edit(@RequestBody RequestAdvance requestAdvance)
//    {
//        return toAjax(requestAdvanceService.updateRequestAdvance(requestAdvance));
//    }
//
//    /**
//     * 删除预付款
//     */
//    @Log(title = "预付款", businessType = BusinessType.DELETE)
//	@DeleteMapping("/{requestIds}")
//    public AjaxResult remove(@PathVariable Long[] requestIds)
//    {
//        return toAjax(advanceService.deleteAdvanceByAdvanceIds(requestIds));
//    }
//
//    /**
//     * 核准
//     */
//    @PreAuthorize("@ss.hasPermi('finance:advance:applicant')")
//    @PutMapping("/updateAdvanceApplicant/{requestIds}/{flay}")
//    public AjaxResult updateAdvanceApplicant(@PathVariable Long[] requestIds,@PathVariable boolean flay){
//        return toAjax(advanceService.updateAdvanceApplicant(requestIds,flay,getNickname()));
//    }
//
//    /**
//     * 查询是否可以批量付款的数据
//     * @param requestIds
//     * @return
//     */
//    @PreAuthorize("@ss.hasPermi('finance:advance:payment')")
//    @GetMapping("/selectAdvanceByRequestId/{requestIds}")
//    public AjaxResult selectAdvanceByRequestId(@PathVariable Long[] requestIds){
//        return success(advanceService.selectAdvanceByRequestId(requestIds));
//    }
//
//    /**
//     * 批量付款
//     * @param requestIds
//     * @return
//     */
//    @PreAuthorize("@ss.hasPermi('finance:advance:applicant')")
//    @PutMapping("/updateAdvanceByAdvanceStatus/{requestIds}")
//    public AjaxResult updateAdvanceByAdvanceStatus(@PathVariable Long[] requestIds){
//        return toAjax(advanceService.updateAdvanceByAdvanceStatus(requestIds));
//    }
//
//    /**
//     * 修改取消申请状态
//     * @param requestIds
//     * @return
//     */
//    @PutMapping("/updateRequestAdvanceCancelStatus/{requestIds}")
//    public AjaxResult updateRequestAdvanceCancelStatus(@PathVariable Long[] requestIds){
//        return toAjax(requestAdvanceService.updateRequestAdvanceCancelStatus(requestIds));
//    }
//
//    /**
//     * 付款完成需要修改申请记录的付款状态
//     * @param requestIds
//     * @return
//     */
//    @PutMapping("/updateRequestAdvancePaymentStatus/{requestIds}")
//    public AjaxResult updateRequestAdvancePaymentStatus(@PathVariable Long[] requestIds){
//        return toAjax(requestAdvanceService.updateRequestAdvancePaymentStatus(requestIds));
//    }
//
//    /**
//     * 批量添加付款单
//     * @param paymentSlipsList
//     * @return
//     */
//    @PostMapping("/insertPaymentSlipsList")
//    public AjaxResult insertPaymentSlipsList(@RequestBody List<PaymentSlips> paymentSlipsList){
//        return toAjax(paymentSlipsService.insertPaymentSlipsList(paymentSlipsList));
//    }
//}
